package com.rc.saas.tenant.mapper.acct;

import com.rc.saas.tenant.common.base.BaseMapper;

import com.rc.saas.tenant.model.acct.AcctBillOrder;
import com.rc.saas.tenant.model.acct.AcctBillOrderExample;
import com.rc.saas.tenant.vo.acct.TenantOperatorOrderDataECharVo;
import com.rc.saas.tenant.vo.acct.TenantOperatorOrderDataVo;
import com.rc.saas.tenant.search.acct.AcctBillOrderSearch;
import com.rc.saas.tenant.search.acct.OrderAcctBillOrderSearch;
import com.rc.saas.tenant.vo.acct.AcctBillOrderResultVo;
import com.rc.saas.tenant.vo.order.OrderPrintVo;
import com.rc.saas.tenant.vo.order.OrderResult;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface AcctBillOrderMapper extends BaseMapper<Long, AcctBillOrder, AcctBillOrderExample> {

    List<AcctBillOrderResultVo> listPageAcctBillOrder(AcctBillOrderSearch acctBillOrderSearch);

    AcctBillOrderResultVo selectAcctBillOrder(Long billOrderId);

    List<OrderResult> listByCondition(OrderAcctBillOrderSearch orderSearch);

    Long listByCondition_COUNT(OrderAcctBillOrderSearch orderSearch);

    BigDecimal sumUnconfirmedAmount(String tenantOperatorCode);

    TenantOperatorOrderDataVo sumTenantOperatorOrderData(@Param("stationId") Long stationId, @Param("startTime") String startTime,
                                                         @Param("endTime") String endTime, @Param("tenantOperatorCode") String tenantOperatorCode);

    List<TenantOperatorOrderDataECharVo> sumTenantOperatorOrderECharData(@Param("stationId") Long stationId, @Param("startTime") String startTime,
                                                                         @Param("endTime") String endTime, @Param("tenantOperatorCode") String tenantOperatorCode);

    int countByNotReviewedOrder(@Param("tenantCode") String tenantCode);

    List<AcctBillOrderResultVo> listAcctBillOrderForComplete(String tenantOperatorCode);


    AcctBillOrderResultVo selectByBillOrderId(String tenantOperatorCode);

    void updateBatchBillOrderApplyId(@Param("withdrawApplyId")Long withdrawApplyId,@Param("orderIds") List<Long> orderIds);

    List<OrderPrintVo> exportOrderInfo(OrderAcctBillOrderSearch orderSearch);

    void updateFactAmount(Long billOrderId);

    void updateWithdrawApplyId(Long withdrawApplyId);

    int countByGeneratedOrder(String tenantCode);

    Long selectLastIdByDay(String tenantCode);

    AcctBillOrderResultVo selectSupplyAcctBillOrder(Long billOrderId);
}